package com.ikos.web.modules.admin.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.IOException;

@Api(value = "登录", tags = "登录操作")
@RestController
@RequestMapping("/admin/login")
public class LoginController extends BaseController {

    @RequestMapping("/check")
    @ApiOperation(value = "用户登录")
    public String checkLogin() {
        return "检查用户登录334";
    }

    /**
     * 验证码
     *
     * @param response
     * @param uuid
     * @throws IOException
     */
    @GetMapping("/captcha")
    @ApiOperation(value = "获取验证码")
    public void captcha(HttpServletResponse response,
                        @ApiParam(name = "uuid",value = "UUID",required = true) @RequestParam String uuid
    ) throws IOException {
        response.setHeader("Cache-Control", "no-store, no-cache");
        response.setContentType("image/jpeg");

        //获取图片验证码
       // String abc = ikosCaptchaService.getCaptcha(uuid);



    }
}
